package com.lanp.gencode.apifox;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author JiangPeng
 * Created with IntelliJ IDEA.
 * Description:  属性字段
 * Date: 2023-12-20 18:20:29
 */
public class ArrayProperties extends Properties {
    protected String type = "array";

    protected Map<String, Object> items = new HashMap<String, Object>() {{
        put("type", "object");
        put("properties", properties);
    }};


    public ArrayProperties(String filed, String type, String title) {
        super(filed, type, title);
    }


    protected Map<String, Properties> properties = new HashMap<>();


    public void addProperties(Properties p){
        properties.put(p.getFiled(), p);
        items.put("properties", properties);
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public void setType(String type) {
        this.type = type;
    }

    public Map<String, Object> getItems() {
        return items;
    }

    public void setItems(Map<String, Object> items) {
        this.items = items;
    }

    public Map<String, Properties> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, Properties> properties) {
        this.properties = properties;
    }
}
